package valueobject

const (
	PatchOptionAdd     = "add"     // 新增
	PatchOptionRemove  = "remove"  // 删除
	PatchOptionReplace = "replace" // 整体替换
	PatchOptionMove    = "move"    // 移动
	PatchOptionCopy    = "copy"    // 复制
)

type Patch[T any] struct {
	Option string `json:"op"`
	Path   string `json:"path"`
	From   string `json:"from"`
	Value  T      `json:"value"`
}

type PatchVO interface {
	IsAdd() bool
	IsRemove() bool
	IsReplace() bool
	IsMove() bool
	IsCopy() bool

	GetPath() string
	GetFrom() string
	GetValue() any
}
